{extend name="public:base" /}

{block name='css'}
<link href="__ADMIN__/css/tree.css" rel="stylesheet">
{/block}
{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <form method="post">
                <!-- 循环第1级菜单 -->
                {volist name=":cache('menu_tree' . session('id'))" id="v" key='k'}
                <div class="one box {$k > 1 ? 'box-top-10' : ''}">
                    <div class="top-menu">
                        <div class="top-module">
                            <div class="checkbox-input">
                                <input name="ids[]" class="one_check" class="oneTree" type="checkbox" value="{$v.id}" onclick="oneTreeAll(this, '{$k - 1}')" {:authChecked(input('id'), $v['id'])}>
                            </div>
                            <span class="checkbox-name">{$v.name}</span>
                        </div>
                    </div>

                    <!-- 循环第2级菜单 -->
                    {notempty name="v.group_menu"}
                    {volist name="v.group_menu" id='vo' key='ke'}
                    <div class="two">
                        <div class="next">
                            <div class="group-menu">
                                <div class="module">
                                    <div class="checkbox-input">
                                        <input name="ids[]" class="two_check" class="twoTree" type="checkbox" value="{$vo.id}" onclick="twoTreeAll(this, '{$k - 1}', '{$ke - 1}')" {:authChecked(input('id'), $vo['id'])}>
                                    </div>
                                    <span class="checkbox-name">{$vo.name}</span>
                                </div>
                            </div>
                            <div style="clear: both"></div>

                            <!-- 循环第3级菜单 -->
                            {notempty name="vo.list_menu"}
                            {volist name="vo.list_menu" id="val" key='kk'}
                            <div class="three">
                                <div class="list-menu">
                                    <div class="module">
                                        <div class="checkbox-input">
                                            <input name="ids[]" class="three_check" class="threeTree" type="checkbox" value="{$val.id}" onclick="threeTreeAll(this, '{$k - 1}', '{$ke - 1}', '{$kk - 1}')" {:authChecked(input('id'), $val['id'])}>
                                        </div>
                                        <span class="checkbox-name">{$val.name}</span>
                                    </div>
                                </div>
                                <div style="clear: both"></div>

                                <!-- 循环第4级菜单 -->
                                {notempty name="val.do_menu"}
                                {volist name="val.do_menu" id="value" key="key"}
                                <div class="four">
                                    <div class="do-menu">
                                        <div class="module">

                                            <div class="checkbox-input {$key > 1 ? 'left-10' : ''}">
                                                <input name="ids[]" class="four_check" class="fourTree" type="checkbox" value="{$value.id}" onclick="fourTreeAll(this, '{$k - 1}', '{$ke - 1}', '{$kk - 1}')" {:authChecked(input('id'), $value['id'])}>
                                            </div>
                                            <span class="checkbox-name">{$value.name}</span>

                                        </div>
                                    </div>
                                </div>
                                {/volist}
                                {/notempty}
                                <div style="clear: both"></div>
                            </div>
                            {/volist}
                            {/notempty}
                        </div>
                    </div>
                    {/volist}
                    {/notempty}
                </div>
                {/volist}

                <div class="hr-line-dashed"></div>

                <input type="hidden" value="{:input('id')}" name="id">

                <div class="form-group row">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button type="button" class="btn btn-w-m btn-primary ajax-post">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

{/block}

{block name="js"}
<script src="__ADMIN__/js/auth_menu.js"></script>
{/block}